﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QLKS.Models
{
    public class TuyChonModel
    {
        //Lấy danh sách tùy chọn
        static public DataTable GetDmTuyChon(string selectColumns)
        {
            return DataProviderModel.QueryResults(string.Format("select {0} from dmTuyChon", selectColumns.Trim() == "" ? "*" : selectColumns)).Tables[0];
        }

        static public DataTable GetDmTuyChon()
        {
            return DataProviderModel.QueryResults(string.Format("select * from dmTuyChon")).Tables[0];
        }

        //Cập nhật DmTuyChon
        static public int Update(DataTable tb)
        {
            string matuychon = tb.Rows[0]["matuychon"].ToString();
            return DataProviderModel.Update(tb, "dmTuyChon", "matuychon");
        }
    }
}
